package com.hp.bon.sgw.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity
@Table(name = "TP_AREA")
public class TPArea {
	// AREA_CODE NUMBER(4) not null,
	// PROV_ID NUMBER(3) not null,
	// AREA_NAME VARCHAR2(40) not null,

	private int areaCode;
	private int provId;
	private String areaName;
	private Date validTime;
	private Date elapseTime;

	@Id
	@Column(name = "AREA_CODE", nullable = false, length = 4)
	public int getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(int areaCode) {
		this.areaCode = areaCode;
	}

	@Column(name = "PROV_ID", nullable = false, length = 3)
	public int getProvId() {
		return provId;
	}

	public void setProvId(int provId) {
		this.provId = provId;
	}

	@Column(name = "AREA_NAME", nullable = true, length = 255)
	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	@Column(name = "VALID_TIME", nullable = true)
	@Temporal(TemporalType.DATE)
	public Date getValidTime() {
		return validTime;
	}

	public void setValidTime(Date validTime) {
		this.validTime = validTime;
	}

	@Column(name = "ELAPSE_TIME", nullable = true)
	@Temporal(TemporalType.DATE)
	public Date getElapseTime() {
		return elapseTime;
	}

	public void setElapseTime(Date elapseTime) {
		this.elapseTime = elapseTime;
	}

	@Transient
	public String toString() {
		return this.areaCode + "|" + this.provId;
	}
}
